class Order < ActiveRecord::Base
  belongs_to :customer
  belongs_to :customer_backup
  belongs_to :user
  #has_one :customer
  has_many :order_backups #修改记录
  has_many :tickets
  
  belongs_to :creator, :class_name => 'User', :foreign_key => 'creator_id' #预定
  belongs_to :canceler, :class_name => 'User', :foreign_key => 'canceler_id' #取消
  belongs_to :printer, :class_name => 'User', :foreign_key => 'printer_id' #确认
  belongs_to :ticket_outer, :class_name => 'User', :foreign_key => 'ticket_outer_id' #出票
  belongs_to :cash_checker, :class_name => 'User', :foreign_key => 'cash_checker_id' #收款
  belongs_to :sender, :class_name => 'User', :foreign_key => 'sender_id' #送票
  
  belongs_to :jj_man, :class_name => 'User', :foreign_key => 'jj_man_id' #接机人
  belongs_to :jj_affirmer, :class_name => 'User', :foreign_key => 'jj_affirm_id' #接机确认人
  belongs_to :last_editer, :class_name => 'User', :foreign_key => 'last_editer_id' #最后编辑人
  
end
